<%@ include file="/webapis/ui/doctype.jspf" %>

<%@ taglib uri="/bbNG" prefix="bbNG"%>
<%@ taglib uri="/bbData" prefix="bbData"%>
<%@ taglib prefix='c' uri="http://java.sun.com/jsp/jstl/core" %>  
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %> 

<script src="../dist/js/jquery-3.1.1.min.js" type="text/javascript"></script>

<fmt:setLocale value="${locale}"/> 
<fmt:bundle basename="messages"/>
<bbNG:genericPage>

<bbNG:jsBlock>
<script type="text/javascript">
jQuery.noConflict();

function importStudentCourse(){
	jQuery.ajax({
    	async: false,
        url: "../studentEnrollments/importStudentEnroll",    
        contentType:"application/json",   
        dataType: "text",
        type: "POST",
        data:"",     
        success: function (result) {
           alert(result);
    },
       error: function (e) {
          alert("failed");
       }
    });
}

function extend(){
	if(jQuery("#extention1").css('display') == 'none' ){
		jQuery("#extention1").css('display','block'); 
	}
	else if(jQuery("#extention2").css('display') == 'none'){
		jQuery("#extention2").css('display','block'); 
	}
		
}

function reduce(){
	if(jQuery("#extention2").css('display') == 'block' ){
		jQuery("#_searchValue2").val("");
		jQuery("#extention2").css('display','none'); 
	}
	else if(jQuery("#extention1").css('display') == 'block'){
		jQuery("#_searchValue1").val=("");
		jQuery("#extention1").css('display','none'); 
	}		
}

function importTeacherCourse(){
	jQuery.ajax({
    	async: false,
        url: "../teacherEnrollments/importTeacherEnroll",    
        contentType:"application/json",   
        dataType: "text",
        type: "POST",
        data:"",     
        success: function (result) {
           alert(result);
    },
       error: function (e) {
          alert("failed");
       }
    });
}

</script>
</bbNG:jsBlock>

<bbNG:breadcrumbBar  environment="sys_admin" navItem="admin_main">
<fmt:message key="index" var="index"/>
<bbNG:breadcrumb href="../index">index</bbNG:breadcrumb>
</bbNG:breadcrumbBar>

<bbNG:actionControlBar>
 <fmt:message key="import.teacherCourse" var="teacherCourse"/>
 <fmt:message key="import.studentCourse" var="studentCourse"/>
 <bbNG:actionButton id="importAction" url="../enrollment/importEnrollment" title="${studentCourse}" onClick = "importStudentCourse()" primary="true"/>
 <bbNG:actionButton id="importAction" url="../enrollment/importEnrollment" title="${teacherCourse}" onClick = "importTeacherCourse()" primary="true"/>
</bbNG:actionControlBar>

<fmt:message key="strButOk" var="strButOk"/>
<bbNG:button id = "refreshBtn" type="PageLevel" label="${strButOk}" url="../index"/>

</bbNG:genericPage>


